<%@ page import="model.UserService" %>
<%@ page import="java.util.Map" %><%--
  Created by IntelliJ IDEA.
  User: sy189
  Date: 2022/5/18
  Time: 8:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>

<body>
<%
        String id = request.getParameter("ID");//获取登录用户的id号
    if(id != null) {
//    if(true) {
        //表示用户已登录
        // 根据id获取该用户信息
        Map<String,String> u = new UserService().getUserById(id);

%>
<%--美化样式--%>
<div style="width: 700px;margin: 0 auto;">
    <form action="../updateUser">
        <input type="hidden" name="id" value="<%=u.get("id")%>"><br>

        用户名:<input class="form-control" id="disabledInput" name="un" value="<%=u.get("username")%>" type="text" placeholder="">
        密码:<input type="password" class="form-control col-2" name="pw"><br>
        电话:<input type="text" class="form-control col-2" name="tel" value="<%=u.get("telephone")%>"><br>
        地址:<input type="text" class="form-control col-2" name="addr" value="<%=u.get("address")%>"><br>
        <input type="submit" class="btn btn-group-toggle" value="提交">&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="reset" class="btn btn-danger" value="重置">
    </form>
</div>
<%
    }
%>
</body>
</html>
